<template>
  <div>
    <!-- 子组件 -->
    <ChildVue/>

    <!-- 父 -->
    <div class="child">
      <ul class="list-group">
        <li class="list-item" v-for="item in list" :key="item">{{ item }}</li>
      </ul>
    </div>
  </div>
</template>

<script setup>
import ChildVue from './Child.vue';
import { ref } from 'vue';
import emitter from './mit'

const list = ref(['JavaScript', 'HTML', 'CSS'])

emitter.on('add', (val) => {
  console.log(val);
  list.value.push(val)
})

</script>

<style>
</style>